package com.woniu.outlet.dao;

import com.woniu.outlet.po.ProSchedulingPo;
import com.woniu.outlet.po.ProSchedulingPoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface ProSchedulingPoMapper {
    long countByExample(ProSchedulingPoExample example);

    int deleteByExample(ProSchedulingPoExample example);

    int deleteByPrimaryKey(Long id);

    int insert(ProSchedulingPo record);

    int insertSelective(ProSchedulingPo record);

    List<ProSchedulingPo> selectByExample(ProSchedulingPoExample example);

    ProSchedulingPo selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") ProSchedulingPo record, @Param("example") ProSchedulingPoExample example);

    int updateByExample(@Param("record") ProSchedulingPo record, @Param("example") ProSchedulingPoExample example);

    int updateByPrimaryKeySelective(ProSchedulingPo record);

    int updateByPrimaryKey(ProSchedulingPo record);

    @Select("select worker.username workerName,wp.working_procedure_code workingProcedureCode,wp.process_name processName,sw.pro_num proNum\n" +
            "            from ERP_pro_scheduling ps\n" +
            "            left join erp_system_management.ERP_worker worker on worker.id=ps.worker_id\n" +
            "            left join sche_work sw on sw.pro_sche_id=ps.id\n" +
            "            left join erp_system_management.ERP_working_procedure wp on wp.id=sw.work_pro_id\n" +
            "            where ps.id=#{id}")
    List<ProSchedulingPo> getProScheById(Long id);
}